In relational database management systems, typically relational queries are supported which may be constrained to return distinct tuples or rows. An example is the SQL keyword DISTINCT which, when used to qualify a query, ensures that there are no duplicate rows in the returned set of data satisfying the query.
In the prior art, such queries are implemented by the returned set of rows or tuples being calculated and then sorted. After the sort is carried out, the duplicate rows are discarded and the unique set of rows or tuples is returned.
Where a relational database is used as a backend for a time sensitive application, such as a website, for example, the time needed to sort the resulting table before discarding the duplicate rows may result in user dissatisfaction. In addition, where the data is to be presented to the user in a previously established order, after duplicate filtering the resulting table must be reordered to reflect that previously established order.
It is therefore desirable to provide an implementation of the relational query that is constrained to return distinct or unique values but which is not subject to initial delays in presenting resulting rows to a user and in which the resulting table retains a previously established ordering.